home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
BUSINESS
/
TAS206.ARJ
/
NHNL.TAS
< prev
next >
Wrap
Text File
|
1991-02-17
|
1KB
|
31 lines
{ NHNL.TAS-
This script example will show the 52 week high and low for each
ticker. If the current day's high is equal to the highest high
or the current low is equal to the lowest low, then we have a
probable new high or new low. It might also be the case that today's
high or low is just equal to the previous high or low.
Just to make the script slightly more interesting, we will also
compute the "percentage off from high", a frequently used metric
seen in financial tables.
}
if first_ticker then
begin
writeln(' - CURRENT - - 52 WEEK - OFF');
writeln('TICKER HIGH LOW HIGH LOW HIGH');
end;
high_value := HHV(h,52*5); { compute high over 52 weeks }
low_value := LLV(L,52*5); { compute low over 52 weeks }
off_high_value := ((high_value - c[0]) / high_value) * 100;
write(TICKER,' ',h[0],' ',l[0],' ',high_value,' ',low_value,
'\t',INT(off_high_value),'%');
if high_value <= h then { today's high is new high }
write(' New High ');
if low_value >= l then { today's low is new low }
write(' New Low ');
writeln(); { end the line with a 'newline'}